﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Abp.Configuration;

namespace Xugege.AbpExtension.Core.Extension.Configuration
{

    /// <summary>
    /// Defines settings extension for the application.
    /// See <see cref="AppSettingsExtension"/> for setting names.
    /// </summary>
    public class AppSettingProviderExtension : SettingProvider
    {
        public override IEnumerable<SettingDefinition> GetSettingDefinitions(SettingDefinitionProviderContext context)
        {
            return new[]
            {
                //Tenant settings
                new SettingDefinition(AppSettingsExtension.TenantManagement.WebSiteTitle,
                
                ConfigurationManager.AppSettings[AppSettingsExtension.TenantManagement.WebSiteTitle]??"",
                isVisibleToClients:true,
                scopes: SettingScopes.Tenant),
                new SettingDefinition(AppSettingsExtension.TenantManagement.WebSiteCompanyName,
                ConfigurationManager.AppSettings[AppSettingsExtension.TenantManagement.WebSiteCompanyName]??"",
                isVisibleToClients:true,
                scopes: SettingScopes.Tenant),
                new SettingDefinition(AppSettingsExtension.TenantManagement.WebSiteLogoPath,
                ConfigurationManager.AppSettings[AppSettingsExtension.TenantManagement.WebSiteLogoPath]??"",
                isVisibleToClients:true,
                scopes: SettingScopes.Tenant),
                new SettingDefinition(AppSettingsExtension.TenantManagement.WebSiteLoginLogoPath,
                ConfigurationManager.AppSettings[AppSettingsExtension.TenantManagement.WebSiteLoginLogoPath]??"",
                isVisibleToClients:true,
                scopes: SettingScopes.Tenant),
            };
        }
    }
}
